package com.zzw.bridge.business.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzw.bridge.business.dto.AddProjectDTO;
import com.zzw.bridge.business.dto.ZzwPierProjectDTO;
import com.zzw.bridge.business.vo.QueryIdVo;
import com.zzw.bridge.business.vo.ZzwPierProjectVo;
import com.zzw.bridge.common.entitys.business.ZzwPierProjectEntity;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 大桥项目表
 *
 * @author XiaoJie
 * @email
 * @date 2025-05-19 10:32:20
 */
public interface ZzwPierProjectService extends IService<ZzwPierProjectEntity> {

    /**
     * 新增大桥项目
     *
     * @param dto "项目dto"
     * @return {@link Boolean}
     */
    String addProject(AddProjectDTO dto, HttpServletRequest request);

    /**
     * 分页查询项目信息
     *
     * @param dto {@link ZzwPierProjectDTO } "查询条件"
     * @return {@link Page<ZzwPierProjectVo>}
     */
    List<ZzwPierProjectVo> queryPage(ZzwPierProjectDTO dto, HttpServletRequest request);

    /**
     * 删除项目
     *
     * @param id  "id"
     * @return    "影响行数"
     */
    Integer removeProject(String id);

    /**
     * 编辑项目
     *
     * @param dto "条件"
     * @return {@link Integer}
     */
    Integer editProject(ZzwPierProjectDTO dto);

    /**
     * 判断末端节点层级
     * @param id "条件"
     * @return {@link Boolean}
     */
    Boolean checkEndLevel(String id,HttpServletRequest request);

    /**
     * 获取项目类型
     * @return {@link HashMap<String,Integer>}
     */
    HashMap<Integer, String> queryProjectType();

    /**
     * 获取ids
     * @return {@link List<String>}
     */
    List<QueryIdVo> queryIdList(Integer projectType);

    /**
     * 根据项目类型分组获取列表
     *
     * @return {@link HashMap<String,List<ZzwPierProjectVo>>}
     */
    Map<Integer,List<ZzwPierProjectVo>> queryTypeList(HttpServletRequest request);

    /**
     * 根据id查vo以及子节点
     *
     * @param request "请求"
     * @param id "id"
     * @return {@link ZzwPierProjectVo}
     */
    ZzwPierProjectVo queryVoById(HttpServletRequest request, String id);
}

